<?php

namespace Tbf\Bundle\PackageBundle\RelationPackage;

class RelationControllerConfig
{
    protected $config;
    public function __construct($config)
    {
        $this->config = $config;
    }
    public function reverseOrder()
    {
        $second = $this->config['first'];
        $first = $this->config['second'];
        $this->config['first'] = $first;
        $this->config['second'] = $second;
    }
    public function getIdName($order)
    {
        return $this->config[$order]['id_name'];
    }
    public function getConditionName($order)
    {
        return $this->config[$order]['condition_name'];
    }
    public function getEntityClassName($order)
    {
        return $this->config[$order]['entity_class_name'];
    }
    public function getEntityName($order)
    {
        return $this->config[$order]['entity_name'];
    }
    public function getGetAnotherListFunctionName($order)
    {
        return $this->config[$order]['get_another_list_function_name'];
    }
    public function getSetAnotherListFunctionName($order)
    {
        return $this->config[$order]['set_another_list_function_name'];
    }
    public function isListQuery()
    {
        return $this->config['is_list_query'];
    }
    public function getPropertyNameToAnother($order)
    {
        return $this->config[$order]['property_name_to_another'];
    }
    public function hasPropertyNameToAnother($order)
    {
        return !empty($this->config[$order]['property_name_to_another']);
    }
    public function hasGetAnotherListFunctionName($order)
    {
        return !empty($this->config[$order]['get_another_list_function_name']);
    }
    public function getIdListName($order)
    {
        return $this->config[$order]['id_list_name'];
    }
}
